{{include file='header.inc.html'}}
    <div id="inner-wrap" class="clear_both">
        <h2 id="im-here">All Posts</h2>
        <div id="box" class="clear_both">
            <div id="inner-content">
                <form method="post" action="{{url controller='posts'}}">
                    <p class="view_type">{{if $smarty.get.status=='all' || !$smarty.get.status && !$smarty.get.cate_id && !$smarty.get.date}}<strong>All ({{$postsCount.all}})</strong>{{else}}<a href="{{url controller='posts'}}">All ({{$postsCount.all}})</a>{{/if}} | {{if $smarty.get.status=='publish'}}<strong>Published ({{$postsCount.publish}})</strong>{{else}}<a href="{{url controller='posts' status='publish'}}">Published ({{$postsCount.publish}})</a>{{/if}} | {{if $smarty.get.status=='draft'}}<strong>Drafts ({{$postsCount.draft}})</strong>{{else}}<a href="{{url controller='posts' status='draft'}}">Drafts ({{$postsCount.draft}})</a>{{/if}}</p>
                    <div class="cmd_options clear_both">
                        {{webcontrol type='pagenav' name='pager' pager=$pager controller='posts' status=$smarty.get.status date=$smarty.get.date cate_id=$smarty.get.cate_id}}
                        <p class="actions">
                            <select name="actions">
                                <option value="">Bulk Actions</option>
                                <option value="delete">Delete</option>
                                <option value="publish">Publish</option>
                            </select>
                            <input type="submit" value="Apply" />
                            <span></span>
                            {{webcontrol type='DropdownList' name='dates' items=$dates selected=$smarty.get.date}}
                            {{webcontrol type='DropdownList' name='categories' items=$cates selected=$smarty.get.cate_id}}
                            <input type="button" value="Filter" id="filter" name="filter" />
                            <input type="hidden" id="filter_action" name="filter_action" value="{{url controller='posts'}}" />
                        </p>
                    </div>
                    <table class="all_w tbox">
                        <tr>
                            <th width="3%" class="tc"><input type="checkbox" id="checkall-t" name="checkall-t" /></th>
                            <th width="40%">Post</th>
                            <th width="15%">Categories</th>
                            <th width="25%">Tags</th>
                            <th width="5%" class="tc"><img src="{{get_app_inf key='THEME_DIR'}}/img/comment.png" /></th>
                            <th width="5%" class="tc"><img src="{{get_app_inf key='THEME_DIR'}}/img/view.png" /></th>
                            <th width="7%">Date</th>
                        </tr>
                        {{foreach from=$posts item=post}}
                        <tr>
                            <td class="tc"><input type="checkbox" id="checkid[]" name="checkid[]" value="{{$post.post_id}}" /></td>
                            <td class="post-title"><a href="{{url controller='posts' action='edit' post_id=$post.post_id}}">{{$post.title}}</a><div class="opt"><a href="{{url controller='posts' action='edit' post_id=$post.post_id}}">Edit</a> | <a href="">View</a> | <a href="{{url controller='posts' action='remove' post_id=$post.post_id}}" class="delete">Delete</a> | <a href="" class="publish">Publish</a></div></td>
                            <td><a href="{{url controller='posts' cate_id=$post.cate_id}}">{{$post.category.name}}</a></td>
                            <td>{{foreach from=$post.tags item=tag}}<a href="">{{$tag.label}}</a> {{/foreach}}</td>
                            <td class="tc"><span><a href="{{url controller='comments' post_id=$post.post_id}}">{{$post.comment_count}}</a></span></td>
                            <td class="tc">{{$post.view_count}}</td>
                            <td>{{$post.created|date_format:"%Y/%m/%d"}}<br />{{$post.status|capitalize}}</td>
                        </tr>
                        {{/foreach}}
                        <tr>
                            <th class="tc"><input type="checkbox" id="checkall-b" name="checkall-b" /></th>
                            <th>Post</th>
                            <th>Categories</th>
                            <th>Tags</th>
                            <th class="tc"><img src="{{get_app_inf key='THEME_DIR'}}/img/comment.png" /></th>
                            <th class="tc"><img src="{{get_app_inf key='THEME_DIR'}}/img/view.png" /></th>
                            <th>Date</th>
                        </tr>
                    </table>
                    <div class="cmd_options clear_both">
                        {{webcontrol type='pagenav' name='pager' pager=$pager controller='posts' status=$smarty.get.status date=$smarty.get.date cate_id=$smarty.get.cate_id}}
                        <p class="actions">
                            <select name="actions">
                                <option value="">Bulk Actions</option>
                                <option value="delete">Delete</option>
                                <option value="publish">Publish</option>
                            </select>
                            <input type="submit" value="Apply" />
                        </p>
                    </div>
                </form>
            </div>
        </div>
    </div>
{{include file='footer.inc.html'}}
